using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Admin_Controls_AddUser : System.Web.UI.UserControl
{
	protected void Page_Load(object sender, EventArgs e)
	{
		this.chkAdmin.Visible = true;
		this.chkManager.Visible = true;
	}
	protected void CreateUserWizard1_CreatedUser1(object sender, EventArgs e)
	{
		// Get the username
		string[] usernames = { CreateUserWizard1.UserName };

		// Add the user to the roles
		if (this.chkManager.Checked)
			Roles.AddUsersToRole(usernames, "SManage_Manager");
		if (this.chkAdmin.Checked)
			Roles.AddUsersToRole(usernames, "SManage_Admin");

		Roles.AddUsersToRole(usernames, "SManage_User");

		this.chkManager.Visible = false;
		this.chkAdmin.Visible = false;
	}
	protected void CreateUserWizard1_ContinueButtonClick(object sender, EventArgs e)
	{
		this.CreateUserWizard1.ActiveStepIndex = 0;
		this.CreateUserWizard1.UserName = "";
		this.CreateUserWizard1.Email = "";
	}
}
